package com.sctvcloud.linshui.ui.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.ruihang.generalibrary.ui.adapter.BaseHolderAbsAdapter;
import com.ruihang.generalibrary.ui.util.OnItemInternalClick;
import com.sctvcloud.linshui.R;
import com.sctvcloud.linshui.application.Constances;
import com.sctvcloud.linshui.beans.NewsItem;
import com.sctvcloud.linshui.ui.adapter.holder.CommonFrgHolder;
import com.sctvcloud.linshui.ui.adapter.holder.FindFellVillagersChatRoomHolder;
import com.sctvcloud.linshui.ui.util.IListShowData;

import java.util.List;

import cn.jpush.im.android.api.model.ChatRoomInfo;

/**
 * IM 聊天室列表适配器
 */
public class FindFellowVillagersChatRoomAdapter extends BaseHolderAbsAdapter<ChatRoomInfo, FindFellVillagersChatRoomHolder> {
    private FindFellVillagersChatRoomHolder.OnChatRommClickListener listener;

    public FindFellowVillagersChatRoomAdapter(Context context, List<ChatRoomInfo> list, FindFellVillagersChatRoomHolder.OnChatRommClickListener listener) {
        super(context, list);
        this.listener = listener;
    }


    @Override
    public FindFellVillagersChatRoomHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(context).inflate(R.layout.item_find_fellow_villagers_chat_room, parent, false);
        FindFellVillagersChatRoomHolder holder = new FindFellVillagersChatRoomHolder(context, view, listener);
        return holder;
    }

    @Override
    public FindFellowVillagersChatRoomAdapter setItemInternalClick(OnItemInternalClick itemInternalClick) {
        super.setItemInternalClick(itemInternalClick);
        return this;
    }

    @Override
    public int getItemViewType(int position) {
        return 0;
    }
}